package cn.gyouzhe.mapper;

import cn.gyouzhe.entity.Category;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 分类mapper
 *
 * @author wangchuan
 * @datetime 2018/3/4 11:14
 */
@Mapper
public interface CategoryMapper {
    /**
     * 查询网站分类
     * @return 分类
     */
    @Select("select id,code,name,sort from g_category order by sort asc")
    @Results({
            @Result(property = "id", column = "id", id = true),
            @Result(property = "code", column = "code"),
            @Result(property = "name", column = "name"),
            @Result(property = "sort", column = "sort")
    })
    List<Category> selectCategory();
}
